<?php 
class db {
	public $conn = NULL;
	public $result = NULL;
	public $host="localhost";
	public $user="joomlavi_jv2013";
	public $pass="mkdirms08-067";
	public $database="joomlavi_jv2013";
	private $author="Hung Phan";
	protected $version="1.1";
	function __construct(){
		$this->conn = mysql_connect($this->host, $this->user, $this->pass);
		mysql_select_db($this -> database, $this->conn);
		mysql_query("set names 'utf8'"); 	 
	} 
	function getdata($sql) {
		if (is_resource($this->conn)) {
		   if (is_resource($this->result)) mysql_free_result($this->result);
		   $this->result = mysql_query( $sql, $this->conn  );
		}
	}
	function fetchRow() {
		if (is_resource($this->result)) {
		   $row = mysql_fetch_assoc($this->result);
		   if (is_array($row))  return $row;    		
		}
		return FALSE;
	}
	
	function getOutlet(){
	
		$sql = "SELECT code,name FROM vip_wrd_outlets WHERE published_cpoint = 1";
		$kq = mysql_query($sql,$this->conn) or die(mysql_error());	
		return $kq;
	}
	
}
?>